﻿
//********************************************************************************//
//创建日期：<创建日期，2016-3-22>
//创建作者：<孙雪婷，sunxueting@shanghai3h.com>
//功能说明：拟定计划查错_浏览
//********************************************************************************//
using BLL;
using BLL.Access;
using Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Class;

namespace Web.Pages.YongShui.JiHuaGL
{
    public partial class NiDingJHCC_Browse : BasePage
    {
        #region 变量
        /// <summary>
        /// 确定计划
        /// </summary>
        YS_JH_QUEDINGJH _YS_JH_QUEDINGJH = new YS_JH_QUEDINGJH();

        /// <summary>
        /// 确定计划BLL
        /// </summary>  
        YS_JH_QUEDINGJHBLL _YS_JH_QUEDINGJHBLL = new YS_JH_QUEDINGJHBLL();

        /// <summary>
        /// 存储过程调用类
        /// </summary>
        SpHelper _SpHelper = new SpHelper();

        #endregion

        #region 属性
        /// <summary>
        /// 保存结果集1
        /// </summary>
        private DataTable dtXiangXiXX
        {
            get
            {
                return ViewState["dtXiangXiXX"] as DataTable;
            }
            set
            {
                ViewState["dtXiangXiXX"] = value;
            }
        }
        #endregion

        #region 事件
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                LoadData();
            }
            gvXiangXiXX.DataSource = this.dtXiangXiXX;
            gvXiangXiXX.DataBind();
        }

        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDaYin_Click(object sender, EventArgs e)
        {
            string str = "打印计划错误详细信息";
            PageTools.AlertMsg(this,str);
        }
        #endregion

        #region 方法
        /// <summary>
        /// 加载数据
        /// </summary>
        private void LoadData() 
        {
            this.dtXiangXiXX = _SpHelper.P_YSJH_CUOWUXXLL(0,"").Tables[0];
            gvXiangXiXX.DataSource = this.dtXiangXiXX;
            gvXiangXiXX.DataBind();

        }
        #endregion

        protected void btnExport_Click(object sender, EventArgs e)
        {
            gvXiangXiXX.DataSource = this.dtXiangXiXX;
            gvXiangXiXX.DataBind();
            ASPxGridViewExporter1.GridViewID = "gvXiangXiXX";
            string sName = "详细信息";
            gvXiangXiXX.Settings.ShowFooter = false;
            ASPxGridViewExporter1.WriteXlsToResponse(sName);

        }
    }
}